import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: AliceMana
 * Date: 2022-09-03
 * Time: 15:25
 */
public class Test {

    // https://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8?tpId=37&&tqId=21320&rp=1&ru=/ta/huawei&qru=/ta/huawei/question-ranking
    public static void main(String[] args) {
     double average = 0.0;

    }

    // https://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f?tpId=37&&tqId=21323&rp=1&ru=/ta/huawei&qru=/ta/huawei/question-ranking
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int sum = 2;
        int ret = 2;
        for (int i = 1; i < n; i++) {
            sum += 3;
            ret += sum;
        }
        System.out.println(ret);
    }
}
